#ifndef _INETADDRESS_H
#define _INETADDRESS_H
#include <my_head.h>
#include <string>
using std::string;
// 所有与地址相关的操作全部在该类中
class InetAddress
{
public:
    InetAddress(unsigned short port, const string ip = "0.0.0.0");
    InetAddress(const struct sockaddr_in &addr);
    string ip() const;
    unsigned short port() const;
    struct sockaddr_in *getInetaddressPtr() { return &_addr; }


private:
    struct sockaddr_in _addr;
};

#endif
